package com.zhentao.api.article.schedule;

import com.zhentao.model.dtos.ResponseResult;
import com.zhentao.model.schedule.dto.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("zhentao-leadnews-schedule")
public interface ISchedule {
    //添加延迟任务
    @PostMapping("/api/v1/task/add")
    ResponseResult addTask(@RequestBody Task task);

    //取消任务
    @GetMapping("/api/v1/task/{taskId}")
    ResponseResult cancelTask(@PathVariable("taskId") Long taskId);

    //按照类型和优先级 拉取任务
    @GetMapping("/api/v1/task/{type}/{priority}")
    ResponseResult poll(@PathVariable("type") Integer type,@PathVariable("priority") Integer priority);
}
